package com.ls.fw.data.search.impl.dao.test.model;

import java.sql.Time;
import java.sql.Timestamp;
import java.util.Date;

import javax.persistence.Entity;

import com.mysema.query.annotations.QueryEntity;

/**
 * @author 李昇
 * 2014年4月13日 下午3:17:45
 */
@Entity
@QueryEntity
public class Person {

	private Long id;
	private long id1=11;
	private String name;
	private String card;
	private Date birthday;
	private Time birthday1;
	private Timestamp birthday2;
	private String address;
	private String remark;
	private Double all;
	private Float avage;
	private UserInfo user;
	
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getCard() {
		return card;
	}
	public void setCard(String card) {
		this.card = card;
	}
	public Date getBirthday() {
		return birthday;
	}
	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public UserInfo getUser() {
		return user;
	}
	public void setUser(UserInfo user) {
		this.user = user;
	}
	public Double getAll() {
		return all;
	}
	public void setAll(Double all) {
		this.all = all;
	}
	public Float getAvage() {
		return avage;
	}
	public void setAvage(Float avage) {
		this.avage = avage;
	}
	 
	public long getId1() {
		return id1;
	}
	public void setId1(long id1) {
		this.id1 = id1;
	}
	 
	public Time getBirthday1() {
		return birthday1;
	}
	public void setBirthday1(Time birthday1) {
		this.birthday1 = birthday1;
	}
	public Timestamp getBirthday2() {
		return birthday2;
	}
	public void setBirthday2(Timestamp birthday2) {
		this.birthday2 = birthday2;
	}
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("Person [");
		if (id != null) {
			builder.append("id=");
			builder.append(id);
			builder.append(", ");
		}
		builder.append("id1=");
		builder.append(id1);
		builder.append(", ");
		if (name != null) {
			builder.append("name=");
			builder.append(name);
			builder.append(", ");
		}
		if (card != null) {
			builder.append("card=");
			builder.append(card);
			builder.append(", ");
		}
		if (birthday != null) {
			builder.append("birthday=");
			builder.append(birthday);
			builder.append(", ");
		}
		if (birthday1 != null) {
			builder.append("birthday1=");
			builder.append(birthday1);
			builder.append(", ");
		}
		if (birthday2 != null) {
			builder.append("birthday2=");
			builder.append(birthday2);
			builder.append(", ");
		}
		if (address != null) {
			builder.append("address=");
			builder.append(address);
			builder.append(", ");
		}
		if (remark != null) {
			builder.append("remark=");
			builder.append(remark);
			builder.append(", ");
		}
		if (all != null) {
			builder.append("all=");
			builder.append(all);
			builder.append(", ");
		}
		if (avage != null) {
			builder.append("avage=");
			builder.append(avage);
			builder.append(", ");
		}
		if (user != null) {
			builder.append("user=");
			builder.append(user);
		}
		builder.append("]");
		return builder.toString();
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((this.address == null) ? 0 : this.address.hashCode());
		result = prime * result
				+ ((this.all == null) ? 0 : this.all.hashCode());
		result = prime * result
				+ ((this.avage == null) ? 0 : this.avage.hashCode());
		result = prime * result
				+ ((this.birthday == null) ? 0 : this.birthday.hashCode());
		result = prime * result
				+ ((this.birthday1 == null) ? 0 : this.birthday1.hashCode());
		result = prime * result
				+ ((this.birthday2 == null) ? 0 : this.birthday2.hashCode());
		result = prime * result
				+ ((this.card == null) ? 0 : this.card.hashCode());
		result = prime * result + ((this.id == null) ? 0 : this.id.hashCode());
		result = prime * result + (int) (this.id1 ^ (this.id1 >>> 32));
		result = prime * result
				+ ((this.name == null) ? 0 : this.name.hashCode());
		result = prime * result
				+ ((this.remark == null) ? 0 : this.remark.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Person other = (Person) obj;
		if (this.address == null) {
			if (other.address != null)
				return false;
		} else if (!this.address.equals(other.address))
			return false;
		if (this.all == null) {
			if (other.all != null)
				return false;
		} else if (!this.all.equals(other.all))
			return false;
		if (this.avage == null) {
			if (other.avage != null)
				return false;
		} else if (!this.avage.equals(other.avage))
			return false;
		if (this.birthday == null) {
			if (other.birthday != null)
				return false;
		} else if (!this.birthday.equals(other.birthday))
			return false;
		if (this.birthday1 == null) {
			if (other.birthday1 != null)
				return false;
		} else if (!this.birthday1.equals(other.birthday1))
			return false;
		if (this.birthday2 == null) {
			if (other.birthday2 != null)
				return false;
		} else if (!this.birthday2.equals(other.birthday2))
			return false;
		if (this.card == null) {
			if (other.card != null)
				return false;
		} else if (!this.card.equals(other.card))
			return false;
		if (this.id == null) {
			if (other.id != null)
				return false;
		} else if (!this.id.equals(other.id))
			return false;
		if (this.id1 != other.id1)
			return false;
		if (this.name == null) {
			if (other.name != null)
				return false;
		} else if (!this.name.equals(other.name))
			return false;
		if (this.remark == null) {
			if (other.remark != null)
				return false;
		} else if (!this.remark.equals(other.remark))
			return false;
		return true;
	}
}
